<?php

use yii\db\Migration;

class m180503_073053_insert_msg_template extends Migration
{
    public function safeUp()
    {
        $this->insert('{{%msg_template}}', [
            'msg_template_code' => 'captcha',
            'msg_template_name' => '短信验证码',
            'sms_text' => '您的验证码是：【{$code}】。请不要把验证码泄露给其他人。',
            'sms_state' => 1,
            'created_at' => time(),
        ]);
    }

    public function safeDown()
    {
        $this->delete('news', ['msg_template_code' => captcha]);
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m180503_073053_insert_msg_template cannot be reverted.\n";

        return false;
    }
    */
}
